package com.frame.base.presenter;

import com.frame.base.model.LoginModel;
import com.frame.base.ui.view.LoginView;

/**
 * Created by Administrator on 2017/10/27.
 */

public class LoginPresenterImp implements LoginPresenter, LoginModel.LoginListener {
    private LoginView view;
    private LoginModel model;

    public LoginPresenterImp(LoginView view) {
        this.view = view;
        this.model = new LoginModel(this);
    }

    @Override
    public void login(String username) {
        view.show();
        model.login(username);
    }

    @Override
    public void success(String s) {
        view.hide();
        view.login(s);
    }

    @Override
    public void fail() {

    }
}
